package InternetHax;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
import java.util.Random;
import javax.microedition.midlet.*;

/**
 * A simple midlet to throw debugging code into, nothing important or long lasting should ever go here
 * @author LoginError
 */
public class DebugMidlet extends MIDlet {

    public void startApp() {
        Random generator = new Random();
        AppFactory factory = new AppFactory();
        int[] exampleDrops = new int[40];
        
        for (int i = 0; i < exampleDrops.length; i++) {
            exampleDrops[i] = generator.nextInt(100);
        }
        
        Toolbox.printDebug("Before alteration");
        for (int i = 0; i < exampleDrops.length; i++) {
            Toolbox.printDebug("i = " +i+ " " +exampleDrops[i]);
            
        }
        
        factory.generateDropTable(exampleDrops);
         
        Toolbox.printDebug("After alteration");
        for (int i = 0; i < exampleDrops.length; i++) {
            Toolbox.printDebug("i = " +i+ " " +exampleDrops[i]);   
        }

        for(int i = 0; i < 15; i++){
            int drop = generator.nextInt(exampleDrops[exampleDrops.length-1]);
            Toolbox.printDebug("Generated "+drop);
            int foundIndex = factory.getDropIndex(drop, exampleDrops);
            Toolbox.printDebug("The App in index " + foundIndex +" will be dropped" );
        }
        
    }

    public void pauseApp() {
    }

    public void destroyApp(boolean unconditional) {
    }
}
